/*
 * Teknei 2014 - All rights reserved
 */
package com.teknei.acabus.core.entities;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * The persistent class for the "NAVIGATION_CHILD" database table.
 * @author Jorge Amaro
 * @version 1.0
 * @since 1.0
 */
@Entity
@Table(name = "\"SITM_NAVIGATION_CHILD\"")
@NamedQueries({
		@NamedQuery(name = "NavigationChild.findAll", query = "SELECT n FROM NavigationChild n"),
		@NamedQuery(name = "NavigationChild.findRelated", query = "SELECT n FROM NavigationChild n where n.navigationParent.idParent = :idParent") })
public class NavigationChild implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "\"NAVIGATION_CHILD_IDCHILD_GENERATOR", sequenceName = "\"NAVIGATION_CHILD_id_seq\"")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "\"NAVIGATION_CHILD_IDCHILD_GENERATOR")
	@Column(name = "id_child", unique = true, nullable = false)
	private Integer idChild;

	private String outcome;

	private String text;

	private String url;

	// bi-directional many-to-one association to NavigationParent
	@ManyToOne
	@JoinColumn(name = "id_parent")
	private NavigationParent navigationParent;

	// bi-directional many-to-one association to NavigationParentRole
	@OneToMany(mappedBy = "child")
	private List<NavigationChildRole> navigationChildRoles;

	/**
	 * 
	 */
	public NavigationChild() {
	}

	/**
	 * @return
	 */
	public Integer getIdChild() {
		return this.idChild;
	}

	/**
	 * @param idChild
	 */
	public void setIdChild(Integer idChild) {
		this.idChild = idChild;
	}

	/**
	 * @return
	 */
	public String getOutcome() {
		return this.outcome;
	}

	/**
	 * @param outcome
	 */
	public void setOutcome(String outcome) {
		this.outcome = outcome;
	}

	/**
	 * @return
	 */
	public String getText() {
		return this.text;
	}

	/**
	 * @param text
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @return
	 */
	public NavigationParent getNavigationParent() {
		return this.navigationParent;
	}

	/**
	 * @param navigationParent
	 */
	public void setNavigationParent(NavigationParent navigationParent) {
		this.navigationParent = navigationParent;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url
	 *            the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "NavigationChild [idChild=" + idChild + ", outcome=" + outcome
				+ ", text=" + text + ", url=" + url + "]";
	}

	/**
	 * @return the navigationChildRoles
	 */
	public List<NavigationChildRole> getNavigationChildRoles() {
		return navigationChildRoles;
	}

	/**
	 * @param navigationChildRoles
	 *            the navigationChildRoles to set
	 */
	public void setNavigationChildRoles(
			List<NavigationChildRole> navigationChildRoles) {
		this.navigationChildRoles = navigationChildRoles;
	}

}